using SO;
using UnityEngine;

namespace Backpack
{
    public interface IItemConfigModel
    {
        public ItemDataSO GetData(int id);
    }
    public class ItemConfigModel : IItemConfigModel
    {
        public static IItemConfigModel Instance = new ItemConfigModel();

        private ItemConfigSO itemConfigSO;
        private ItemConfigModel()
        {
            itemConfigSO = Resources.Load<ItemConfigSO>("Data/ItemConfigSO");
        }
        public ItemDataSO GetData(int id)
        {
            return itemConfigSO.itemDataSOs.Find((data) => data.id == id);
        }
    }
}